package com.pbase.domain.usercase;

import com.kunminx.architecture.ui.callback.UnPeekLiveData;

import androidx.lifecycle.DefaultLifecycleObserver;

/**
 * User: psn
 * Date: 2021/7/12
 * 生命周期相关请求 base类中与各界面绑定
 * 继承他的子类需要做初始化相关，可重写setTag方法做相关操作，setTag方法在绑定生命周期前执行
 */
public class BaseUserCase implements DefaultLifecycleObserver {
    //等待弹框控制
    protected  UnPeekLiveData<Boolean> isShowWaitDialog = new UnPeekLiveData<>();
    //错误提示
    protected UnPeekLiveData<String> errorTip = new UnPeekLiveData<>();
    //配合http基类实现CompositeDisposable对于界面的复用
    protected Class tag;

    public void setTag(Class tag) {
        this.tag = tag;
    }

    public void setIsShowWaitDialog(UnPeekLiveData<Boolean> isShowWaitDialog) {
        this.isShowWaitDialog = isShowWaitDialog;
    }

    public void setErrorTip(UnPeekLiveData<String> errorTip) {
        this.errorTip = errorTip;
    }
}
